package com.arch.dev.client.vo;

import java.math.BigDecimal;
import java.util.Date;

import com.google.gwt.view.client.ProvidesKey;

public class BudgetVO extends BaseVO {
	private Date date;

	private CatagoryVO catagoryVO;

	private BigDecimal cost;

	public BigDecimal getCost() {

		return cost;

	}

	public void setCost(BigDecimal cost) {

		this.cost = cost;

	}

	public CatagoryVO getCatagoryVO() {

		return catagoryVO;

	}

	public void setCatagoryVO(CatagoryVO catagoryVO) {

		this.catagoryVO = catagoryVO;

	}

	private String description;

	public BudgetVO() {

	}

	public BudgetVO(String desc, Date date) {

		this.description = desc;

		this.date = date;

	}

	public Date getDate() {

		return date;

	}

	public String getTitle() {

		return description;

	}

	public void setDate(Date date) {
	
		this.date = date;

	}

	public void setTitle(String description) {

		this.description = description;

	}

	@Override
	public String toString() {

		return new String("Id : " + getId() + "Description : " + description
				+ " Date : " + date + " Cost : " + cost + "\n");

	}

	/**
	 * 
	 * The key provider that provides the unique ID of a contact.
	 */

	public static final ProvidesKey<BudgetVO> KEY_PROVIDER = new ProvidesKey<BudgetVO>() {

		
		public Object getKey(BudgetVO item) {

			return item == null ? null : item.getId();

		}

	};

	public boolean equals(Object obj) {

		BudgetVO budgetVo = (BudgetVO) obj;

		return getId().equals(budgetVo.getId());

	};
}
